var NS = NS || {};
NS.App.Popup = new Class({
	Extends: NS.App,

	/**
	 * Constructor
	 */
	initialize: function(){
		this.parent();

		// Start field
		$('start')
			.set('value', localStorage.fw_start)
			.addEvent('change', function(){
				localStorage.fw_start = this.value;
			});

		// End field
		$('end')
			.set('value', localStorage.fw_end)
			.addEvent('change', function(){
				localStorage.fw_end = this.value;
			});

		// Badge field
		$('badge')
			.set('value', localStorage.fw_badge)
			.addEvent('change', function(){
				localStorage.fw_badge = this.get('value');
			});

		// Notify field
		$('notify')
			.set('checked', !!+localStorage.fw_notify)
			.addEvent('change', function(){
				localStorage.fw_notify = +this.get('checked');
			});
	}
});
